package com.iv.durian.cloud.facade.support;

import com.iv.durian.cloud.StudentLession;
import com.iv.durian.cloud.facade.StudentLessonFacade;
import com.iv.durian.cloud.service.StudentLessonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class StudentLessonFacadeImpl implements StudentLessonFacade {

    @Autowired
    private StudentLessonService studentLessonService;

    @Override
    public StudentLession get(@PathVariable(name = "studentLessionId") Integer studentLessionId){ return studentLessonService.get(studentLessionId); }

    @Override
    public void add(@RequestBody StudentLession studentLession) {
        studentLessonService.add(studentLession);
    }

    @Override
    public void updateStatust(@RequestBody StudentLession studentLession) {
        studentLessonService.updateStatust(studentLession);
    }

    @Override
    public void update(@RequestBody StudentLession studentLession) {
        studentLessonService.update(studentLession);
    }

    @Override
    public int remove(@PathVariable(name = "studentLessionId") Integer studentLessionId) {
        return studentLessonService.remove(studentLessionId);
    }
}
